﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Kunde/WebsiteCustomer.Master" AutoEventWireup="true" CodeBehind="Hjulskift.aspx.cs" Inherits="TireService.Website.Kunde.Hjulskift" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRatingControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">

    <h3>Hjulskift</h3>
    
    <dxwgv:ASPxGridView ID="gvServiceCarScheduleDetail" runat="server" ClientInstanceName="gvServiceCarScheduleDetail" 
        KeyFieldName="ServiceCarScheduleDetailId" AutoGenerateColumns="False" EnableCallBacks="True">
        <SettingsLoadingPanel Text="Henter&amp;hellip;" />
        <SettingsPager AlwaysShowPager="false" PageSize="10" Position="Bottom">
            <Summary 
                AllPagesText="Sider: {0} - {1} ({2} hjulskift)" 
                Text="Side {0} af {1} ({2} hjulskift)" />
        </SettingsPager>
        <SettingsText EmptyDataRow="Ingen hjulskift registreret endnu" />
        <SettingsBehavior ConfirmDelete="True" AllowGroup="true" AllowDragDrop="true" />
        <Columns>                    
            <dxwgv:GridViewDataHyperLinkColumn FieldName="ServiceCarScheduleDetailId" VisibleIndex="3" Caption="Rating">
                <PropertiesHyperLinkEdit NavigateUrlFormatString="~/Kunde/Anmeld.aspx?Id={0}" Text="Anmeld/giv feedback" >
                </PropertiesHyperLinkEdit>
            </dxwgv:GridViewDataHyperLinkColumn>
            <dxwgv:GridViewDataColumn Caption="Rating" VisibleIndex="3">
                <DataItemTemplate>
                    <dx:ASPxRatingControl ID="rcRating" ReadOnly="true" Visible='<%# Eval("CustomerRated") %>' Value='<%# GetCustomerRating(Convert.ToBoolean(Eval("CustomerRated")), Convert.ToInt32(Eval("ServiceCarScheduleDetailId"))) %>' runat="server">
                    </dx:ASPxRatingControl>
                </DataItemTemplate>
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="CarBrandDescription" VisibleIndex="3" Caption="Bil">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataTextColumn FieldName="TireTypeDescription" VisibleIndex="3" Caption="Skift til">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="TireBrandDescription" VisibleIndex="3" Caption="Mærke">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataColumn FieldName="ScheduleDate" VisibleIndex="3" Caption="Dato">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="StartTime" VisibleIndex="3" Caption="Start">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="EndTime" VisibleIndex="3" Caption="Slut">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="ToAddress" VisibleIndex="3" Caption="Adresse">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="ToZipCode" VisibleIndex="3" Caption="Postnr">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="ToCity" VisibleIndex="3" Caption="By">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="WorkCompleted" VisibleIndex="3" Caption="Udført">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn Caption="Godkend/Afvis planlagt tid" VisibleIndex="8">
                <DataItemTemplate>
                    <asp:ImageButton ID="btnConfirm" PostBackUrl='<%# string.Format("~/Godkendtidspunkt.aspx?ApprovalId={0}", Eval("DetailGuid")) %>' ToolTip="Klik her for, at godkende tid for planlagt hjulskift" Visible='<%# (Convert.ToBoolean(Eval("WorkCompleted")) == false & Convert.ToBoolean(Eval("CustomerConfirmed")) == false) %>' runat="server" />&nbsp;
                    <asp:ImageButton ID="btnDecline" PostBackUrl='<%# string.Format("~/Godkendtidspunkt.aspx?ApprovalId={0}&Approve=false", Eval("DetailGuid")) %>' ToolTip="Klik her for, at afvise tid for planlagt hjulskift" Visible='<%# (Convert.ToBoolean(Eval("WorkCompleted")) == false & Convert.ToBoolean(Eval("CustomerConfirmed")) == false) %>' runat="server" />
                </DataItemTemplate>
            </dxwgv:GridViewDataColumn>

        </Columns>                                            
    </dxwgv:ASPxGridView>

</asp:Content>
